package com.openharmony.filepicker.filetype;


import com.openharmony.filepicker.ResourceTable;

public class TextFileType extends FileType{

    public TextFileType() {
        this.setFileType("Text");
        this.setFileIconResId(ResourceTable.Media_ic_unknown_file_picker);
    }

    @Override
    public boolean verify(String fileName) {
        boolean isHasSuffix = fileName.contains(".");
        if (!isHasSuffix) {
            return false;
        }
        String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);

        switch (suffix) {
            case "doc":
            case "docx":
            case "log":
            case "txt":
            case "msg":
            case "odt":
            case "pages":
            case "rtf":
            case "tex":
            case "wpd":
            case "wps":
                return true;
            default:
                return false;
        }
    }

}
